import time
import boto3
from boto3.session import Session
start_time = time.time()  #程序开始时间
region_name = "cn-northwest-1"
FORMAL_S3_CONFIG = {'access_key': 'AKIAWTBG3E42IRH4OLX3', 'secret_key': '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'}
session = Session(FORMAL_S3_CONFIG['access_key'], FORMAL_S3_CONFIG['secret_key'], region_name=region_name)
s3 = session.resource('s3')
s3_client1 = session.client('s3')
bucket = 'dws'
s3_client1.download_file(bucket, 'fridge/detection_test/select_tmp/Unsaved/2023/07/07/3db3dee3-0ac9-4b3f-a710-421387abbb0b.csv', 'test.csv')
end_time = time.time()    #程序结束时间
run_time = end_time - start_time    # 程序的运行时间，单位为秒
print("处理时间:%*.3fs" % (3,  run_time))
